<#assign base=request.contextPath />
<!DOCTYPE html>
<div class="row">
	<div class="col-md-12 col-sm-12 col-xs-12">
		<div class="x_panel">
			<div class="x_title">
				<h2>举报审核 <small></small></h2>
				<div class="clearfix"></div>
			</div>
			<div class="x_content">
				<br/>
				<form id="postForm" data-parsley-validate class="form-horizontal form-label-left" method="post" action="${base}/gx/sysReport/doCheck">
					<input type="hidden" id="id" name="id" value="${((rep.id)?c)!0 }">
		          
		            
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">资讯标题 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="infoTitle" name="infoTitle" value="${(obj.infoTitle)!''}" class="form-control col-md-7 col-xs-12" disabled="disabled">
                        </div>
					</div>
			
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">资讯封面图 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="file" id="icon_dropify" name="file" class="dropify" data-default-file="${imagePath}${(obj.infoIcon)!''}" data-max-file-size="1M" disabled="disabled"/>
                            <input type="hidden" name="infoIcon" id="infoIcon" value="${(obj.infoIcon)!''}">
                            <input type="hidden" name="infoIconOld" id="infoIconOld" value="${(obj.infoIcon)!''}">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">资讯简介 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="infoRemark" name="infoRemark" value="${(obj.infoRemark)!''}" class="form-control col-md-7 col-xs-12" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">资讯描述 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="infoDesc" name="infoDesc" value="${(obj.infoDesc)!''}" class="form-control col-md-7 col-xs-12" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">资讯内容 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	
                        	<div id="content_summernote" class="summernote" >
                                        ${(obj.infoContents)!''}
                        	</div>
                            <input type="hidden" name="infoContents" id="infoContents">
              
                        </div>
					</div>
					

					
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">资讯关键字 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="infoKey" name="infoKey" value="${(obj.infoKey)!''}" class="form-control col-md-7 col-xs-12" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">资讯作者 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="infoAuthor" name="infoAuthor" value="${(obj.infoAuthor)!''}" class="form-control col-md-7 col-xs-12" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">资讯来源 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="infoSource" name="infoSource" value="${(obj.infoSource)!''}" class="form-control col-md-7 col-xs-12" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">审核结果<span class="required"></span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	通过：<input type="radio" class="flat" name="isCheck" value="1" <#if (rep.isCheck==1)>checked="checked"</#if>/>&nbsp;
                        	不通过：<input type="radio" class="flat" name="isCheck" value="2" <#if (rep.isCheck==2)>checked="checked"</#if>/>
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">不通过原因 <span class="required"></span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="checkContent" name="checkContent" value="${(obj.checkContent)!''}" class="form-control col-md-7 col-xs-12">
                        </div>
					</div>
					<div class="ln_solid"></div>
					<div class="form-group">
						<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
							<button type="button" class="btn btn-success" id="submit">保存</button>
							<button type="button" class="btn btn-primary" id="goBack">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
$(function() {

	if ($("input.flat")[0]) {
		$(document).ready(function () {
	    	$('input.flat').iCheck({
	        	checkboxClass: 'icheckbox_flat-green',
	        	radioClass: 'iradio_flat-green'
	        });
	    });
	}
	//select2
	$(".select2").select2({width: "100%"});
	$('.summernote').summernote({
        height: 350, // set editor height
        minHeight: null, // set minimum height of editor
        maxHeight: null, // set maximum height of editor
        focus: false, // set focus to editable area after initializing summernote
        lang: 'zh-CN',
        shortcuts:false, //禁止使用快捷键
          toolbar: [
    // [groupName, [list of button]]
    ['style', ['bold', 'italic', 'underline', 'clear']],
    ['font', ['strikethrough', 'superscript', 'subscript']],
    ['fontsize', ['fontsize']],
    ['color', ['color']],
    ['para', ['ul', 'ol', 'paragraph']],
    ['height', ['height']]
  ]
    });
	 $('.dropify').dropify({
     	messages: {
		        'default': '点击或拖拽文件到这里',
		        'replace': '点击或拖拽文件到这里来替换文件',
		        'remove':  '移除文件',
		        'error':   '对不起，你上传的文件太大了',
		    }
     });
     // Used events
     drEvent = $('#icon_dropify').dropify();
     drEvent.on('dropify.afterClear', function(event, element) {
     	$("#infoIcon").val("");
     });

     drEvent.on('dropify.errors', function(event, element) {
         console.log('Has Errors');
     });

	$("#goBack").click(function() {
		$("#main_content").load('${base}/gx/sysReport/list');	        
    });
	
	$("#submit").click(function() {

        $("#postForm").ajaxSubmit(function(data) {
    	 	if (data.flag) {
    	 		swal(data.msg, "", "success");
				$("#main_content").load('${base}/gx/sysReport/list');
    	 	} 
    	 	else {
    	 		swal(data.msg, "", "error");
    	 	}
    	});
	});
});
//去除页面标签参数
function filterhtml(msg) {
        var msg = msg.replace(/<\/?[^>]*>/g, ''); //去除HTML Tag
        msg = msg.replace(/[|]*\n/, '') //去除行尾空格
        msg = msg.replace(/&nbsp;/ig, ''); //去掉npsp
        return msg;
}
</script>